﻿<%@ Page Title="" Language="C#" MasterPageFile="~/GT.Site.Master" AutoEventWireup="true" CodeBehind="Aprobar-Riesgos.aspx.cs" Inherits="TMD.GT.Site.Vistas.AlineacionComponente.Aprobar_Riesgos" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

<script language="javascript" type="text/javascript">
    function GetCheckStatus() {
        var srcControlId = event.srcElement.id;

        var targetControlId = event.srcElement.id.replace('chkRiesgo', 'ddlImpacto');
        
        if (document.getElementById(srcControlId).checked)
            document.getElementById(targetControlId).disabled = false;
        else
            document.getElementById(targetControlId).disabled = true;

        var targetControlId = event.srcElement.id.replace('chkRiesgo', 'ddlProbabilidad');

        if (document.getElementById(srcControlId).checked)
            document.getElementById(targetControlId).disabled = false;
        else
            document.getElementById(targetControlId).disabled = true;

    }

    function CalculaVCI() {
        alert("son");

        var srcControlId = event.srcElement.id;

        var targetControlId = event.srcElement.id.replace('ddlImpacto', 'ddlProbabilidad');
        alert(document.getElementById(targetControlId).value);

    }










</script>


    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            height: 21px;
        }
        .style3
        {
            height: 27px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    
        <table class="style1">
            <tr>
                <td>
                    <fieldset>
                        <legend>Evaluar riesgos de componente</legend>
                        <table class="style1">
                            <tr>
                                <td class="style2">
                                    Código:</td>
                                <td class="style2">
                                    <asp:Label ID="lblCodigo" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Descripción:</td>
                                <td>
                                    <asp:Label ID="lblDescripcion" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Estado:</td>
                                <td>
                                    <asp:Label ID="lblEstado" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Prioridad:</td>
                                <td>
                                    <asp:Label ID="lblPrioridad" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Riesgos:</td>
                                <td>
                                    <asp:GridView ID="gvRiesgos" runat="server" AutoGenerateColumns="False" 
                                        >
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hddRiesgo" runat="server" 
                                                        Value='<%#Eval("CODIGO_RIESGO") %>'
                                                         />
                                                    <asp:CheckBox ID="chkRiesgo" runat="server" 
                                                         Enabled="true" AutoPostBack="True" oncheckedchanged="chkRiesgo_CheckedChanged"  
                                                         />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField HeaderText="Riesgo" DataField="DESCRIPCION" />
                                            <asp:TemplateField HeaderText="Impacto"> 
                                                <ItemTemplate>  
                                                    <asp:DropDownList ID="ddlImpacto" runat="server" 
                                                        onselectedindexchanged="ddlImpactoIndexChange" AutoPostBack="True">
                                                                    <asp:ListItem>1</asp:ListItem>
                                                                    <asp:ListItem>2</asp:ListItem>
                                                                    <asp:ListItem>3</asp:ListItem>
                                                                    <asp:ListItem>4</asp:ListItem>
                                                                    <asp:ListItem>5</asp:ListItem>
                                                                    <asp:ListItem>6</asp:ListItem>
                                                                    <asp:ListItem>7</asp:ListItem>
                                                                    <asp:ListItem>8</asp:ListItem>
                                                                    <asp:ListItem>9</asp:ListItem>
                                                                    <asp:ListItem>10</asp:ListItem>
                                                     </asp:DropDownList>
                                                 </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Probabilidad">
                                                <ItemTemplate>
                                                    <asp:DropDownList ID="ddlProbabilidad" runat="server" 
                                                        Enabled="true" 
                                                        onselectedindexchanged="ddlProbabilidadIndexChange" AutoPostBack="True">
                                                                    <asp:ListItem>1</asp:ListItem>
                                                                    <asp:ListItem>2</asp:ListItem>
                                                                    <asp:ListItem>3</asp:ListItem>
                                                                    <asp:ListItem>4</asp:ListItem>
                                                                    <asp:ListItem>5</asp:ListItem>
                                                                    <asp:ListItem>6</asp:ListItem>
                                                                    <asp:ListItem>7</asp:ListItem>
                                                                    <asp:ListItem>8</asp:ListItem>
                                                                    <asp:ListItem>9</asp:ListItem>
                                                                    <asp:ListItem>10</asp:ListItem>
                                                     </asp:DropDownList>
                                                 </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td class="style3">
                                    Valor de balanceo:</td>
                                <td class="style3">
                                    <asp:TextBox ID="txtValorBalanceo" runat="server" ReadOnly="True" 
                                        Enabled="False"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Activar:</td>
                                <td>
                                    <asp:RadioButton ID="optActivar" runat="server" GroupName="grpActivar" />
                                    Activar componente<br />
                                    <br />
                                    <br />
                                    <asp:RadioButton ID="optNoActivar" runat="server" GroupName="grpActivar" />
                                    NO activar componente</td>
                            </tr>
                            <tr>
                                <td>
                                    Observación/<br /> comentarios:</td>
                                <td>
                                    <asp:TextBox ID="txAObservacion" runat="server" Height="75px" 
                                        TextMode="MultiLine" Width="271px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="2" style="text-align: center">
                                    <asp:Button ID="btnGuardar" runat="server" onclick="btnGuardar_Click" 
                                        Text="Guardar" Width="83px" />
                                    <asp:Button ID="btnCancelar" runat="server" Text="Regresar" Width="83px" 
                                        onclick="btnCancelar_Click" />
                                </td>
                                    <td>
                                        &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </fieldset>
                </td>
            </tr>
        </table>

     </ContentTemplate>
</asp:UpdatePanel>

</asp:Content>
